﻿@{
    Layout = "~/Views/Shared/_Layout.cshtml";
    ViewData["Title"] = "我的帖子";
}
@model Mango.Web.ViewModels.UserPostsViewModel

    <div class="row">
        <!--左边菜单部分-->
        <div class="col-lg-3">
            @Html.PartialAsync("~/Areas/User/Views/Menu.cshtml").Result
        </div>
        <div class="col-lg-9">
            <div class="my-3 p-3 bg-white rounded box-shadow">
                @foreach (var item in Model.ListData)
                {
                    <div class="media pt-2 border-bottom border-gray ">
                        <div class="row col-lg-12">
                            <div class="col-lg-10">

                                <div class="media-body pb-3 mb-0 small lh-125">
                                    <a href="/posts/read/@item.PostsId" target="_blank" style="color:black;"><h6 class="d-block">@item.Title</h6></a>
                                    <span><img src="~/style/bootstrap/dist/icons/clock.svg" style="width:12px;height:12px;" title="发布时间" />：@item.PostDate.ToString("yyyy-MM-dd HH:mm:ss")</span>

                                    <span style="margin-left:10px;"><img src="~/style/bootstrap/dist/icons/eye.svg" style="width:12px;height:12px;" title="浏览次数" />：@item.ReadCount</span>

                                    <span style="margin-left:10px;"><img src="~/style/bootstrap/dist/icons/comment.svg" style="width:12px;height:12px;" title="回复数" />：@item.AnswerCount</span>
                                </div>
                            </div>
                            <div class="col-lg-2">
                                <a href="/user/posts/edit/@item.PostsId" class="btn btn-success btn-sm">编辑</a>
                            </div>
                        </div>
                        
                    </div>

                }
                <div class="row" style="margin-top:10px;">
                    <div class="col-lg-12">
                        <nav aria-label="">
                            <ul class="pagination">
                                @if (Model.TotalCount > 0)
                                {
                                    @Html.Pager(ViewContext.HttpContext.Request, 10, Model.TotalCount)
                                }
                                else
                                {
                                    <li>没有数据记录...</li>
                                }
                            </ul>
                        </nav>
                    </div>
                </div>
            </div>
        </div>

    </div>    

@section Scripts{
    <script src="~/lib/artdialog/dialog.min.js"></script>
    <script type="text/javascript">
    $(window).ready(function () {
        //选中左边菜单栏
        $("#leftmenu_Posts").addClass("active");
    });
    </script>
}
